<?php
namespace app\weixin\controller;

use think\Db;
use think\Request;
class Zhanhui extends \think\Controller
{
    public function index()
    {
        $chengshi = input('chengshi','晋城');
        $where['city'] = $chengshi;
        $city = Db::table('zhanhui_chengshi')->where($where)->find();
        $this->assign('t', $city);
        return view();
    }
    //每个展厅页面
    public function city()
    {
        $s = input('param.');
      

           $where['city'] = $s['chengshi'];

        
        $list = Db::table('zhanhui_shangjia')->where($where)->select();
        $this->assign('list', $list);
        return view();
    }
   
   public function zc(){

    $list = Db::table('zhanhui_shangjia')->where('city','晋城')->select();
        $this->assign('list', $list);
    return view();
   }


    public function geturl()
    {
        $chengshi = input('chengshi');
        $json['url'] = url('index', ['chengshi' => $chengshi]);
        return json($json);
    }

    public function ztlist(){
          
           $list = Db::table('zhanhui_shangjia')->where($where)->select();
           $this->assign('list',$list);
          return view();
          


    }

    public function cplist(){
        $where['ztname']=input('name');
         $list = Db::table('zhanhui_dbcp')->where($where)->select();
           $this->assign('list',$list);
        
        return view();
    }

    public function alldata(){
        
       $where['addtime']=['between',"2017-10-11 00:00:01,2017-10-11 23:59:59"];
       $num['n11']= Db::table('user')->where($where)->count();  

       $where['addtime']=['between',"2017-10-12 00:00:01,2017-10-12 23:59:59"];
       $num['n12']= Db::table('user')->where($where)->count();  

       $where['addtime']=['between',"2017-10-13 00:00:01,2017-10-13 23:59:59"];
       $num['n13']= Db::table('user')->where($where)->count();  

       $where['addtime']=['between',"2017-10-14 00:00:01,2017-10-14 23:59:59"];
       $num['n14']= Db::table('user')->where($where)->count();  

       $where['addtime']=['between',"2017-10-15 00:00:01,2017-10-15 23:59:59"];
       $num['n15']= Db::table('user')->where($where)->count();  

        $where['addtime']=['gt',"2017-10-11 00:00:00"];
       $num['all']=Db::table('user')->where($where)->count();  

      

     

       $this->assign('num',$num);

         return view();




    }
}